<style src="./commission.css" scoped ></style>
<template>
  <vue-tab current="commission"></vue-tab>
  <div class="sec-top">
    <div class="form-inline">
      <select class="form-control" v-model="status">
        <option value="" selected>全部</option>
        <option value="1" >待审核</option>
        <option value="2" >已发奖</option>
        <option value="3">不发奖</option>
      </select>
      <label>手机号:</label>
      <input type="number" class="form-control input-sm" placeholder="输入手机号搜索"  v-model="phone">
      <button class="btn btn-primary btn-sm" @click="getList">搜索</button>
    </div>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <div class="fl-right">
      <button :disabled="noSelectUser" class="btn btn-sm btn-primary" @click="batch('')">批量发放</button>
    </div>
  </div>
  <table class="table table-bordered table-hover">
    <caption>用户列表</caption>
    <thead>
      <tr>
        <th><input type="checkbox" v-model="checkAll" >全选</th>
        <th>流水号</th>
        <th>手机号</th>
        <th>证券账户</th>
        <th>姓名</th>
        <th>免佣开始时间</th>
        <th>免佣结束时间</th>
        <th>免佣理由</th>
        <th>获得免佣天数</th>
        <th>创建时间</th>
        <th>发奖状态</th>
      </tr>
    </thead>
    <tbody>
      <tr v-for="(index, item) in list">
        <td><input v-if="+item.status === 1" value={{item.id}} type="checkbox" :data-fundId=item.fundId v-model="checkedIds" id={{item.id}}></td>
        <td>{{index + 1}}</td>
        <td>{{item.phone}}</td>
        <td>{{item.fundId}}</td>
        <td>{{item.name}}</td>
        <td>{{item.freeStartTime}}</td>
        <td>{{item.freeEndTime}}</td>
        <td>{{item.reasonDesc}}</td>
        <td>{{item.free}}</td>
        <td>{{item.time}}</td>
        <td>
          <button v-if="+item.status === 1" class="btn btn-sm btn-primary" @click="update(item.id, 2, item.fundId)">发奖</button>
          <button v-if="+item.status === 1" class="btn btn-sm btn-primary" @click="update(item.id, 3, item.fundId)">不发奖</button>
          <span v-if="+item.status === 2" >已发</span>
          <span v-if="+item.status === 3">不发奖</span>
        </td>
      </tr>
    </tbody>
  </table>
  <vue-modal
    title="提示"
    ok-text="确定"
    cancel-text="取消"
    :show.sync="showConfirm"
    effect="fade"
    small="true"
    :callback="submit">
    <div slot="modal-body" class="modal-body">
      用户还没有资金账户，确定发放免佣？
    </div>
  </vue-modal>
  <vue-pages :pages.sync="pages" :get-list="getList"></vue-pages>
</template>

<script type="text/javascript" src="./commission.js"></script>
